package test20;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-12-01
 * Time: 19:42
 */
class Employee{
    int id;
    String name;
    double salary;

    public Employee(int id, String name, double salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }
}
public class Main {
    public static void main(String[] args) {
        Employee e1 = new Employee(1,"张三",5000.0);
        Employee e2 = new Employee(2,"李四",5500.0);
        Employee e3 = new Employee(3,"赵六",4000.0);
        List<Employee> list=new ArrayList<>();
        list.add(e1);
        list.add(e2);
        list.add(e3);
        System.out.println("员工姓名     员工薪资");
        Iterator<Employee>it = list.iterator();
        while(it.hasNext()){
            Employee e = it.next();
            System.out.println(e.name+"        "+e.salary);
        }
    }
}
